All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.sun.java.swing.SyntheticImage
Normal usage looks something like this:
Image i = new Image(new SyntheticImage(200, 100) { protected void computeRow(int y, int[] row) { for(int i = width; --i>=0; ) { int grey = i*255/(width-1); row[i] = (255<<24)|(grey<<16)|(grey<<8)|grey; } } }This creates a image 200 pixels wide and 100 pixels high that is a horizontal grey ramp, going from black on the left to white on the right.
If the image is to be a movie, override isStatic to return false, y cycling back to 0 is computeRow's signal that the next frame has started. It is acceptable (expected?) for computeRow(0,r) to pause until the appropriate time to start the next frame.
protected int width
protected int height
public static final int pixMask
protected SyntheticImage()
protected SyntheticImage(int w, int h)
protected void computeRow(int y, int row[])
public synchronized void addConsumer(ImageConsumer ic)
public synchronized boolean isConsumer(ImageConsumer ic)
public synchronized void removeConsumer(ImageConsumer ic)
public synchronized void startProduction(ImageConsumer ic)
protected boolean isStatic()
public void nextFrame(int param)
public void requestTopDownLeftRightResend(ImageConsumer ic)
All Packages Class Hierarchy This Package Previous Next Index